<div class="tree-item level-{$level}">
    <div class="tree-item-content">
        {if $user.childlist && count($user.childlist) > 0}
        <div class="tree-toggle" onclick="toggleNode(this)">
            <i class="fa fa-chevron-right"></i>
        </div>
        {else}
        <div class="tree-toggle-placeholder"></div>
        {/if}
        
        <div class="user-avatar">
            {if $user.avatar}
            <img src="{$user.avatar}" alt="{$user.nickname}">
            {else}
            <div class="avatar-placeholder">{$user.nickname|substr=0,1}</div>
            {/if}
        </div>
        
        <div class="user-details">
            <div class="user-name">
                <span class="nickname">{$user.nickname}</span>
                <span class="username">({$user.username})</span>
                <span class="user-id">#{$user.id}</span>
            </div>
            <div class="user-stats">
                <span class="badge {if $user.status == 'normal'}status-normal{else}status-disabled{/if}">
                    {if $user.status == 'normal'}正常{else}禁用{/if}
                </span>
                {if $user.children_count > 0}
                <span class="badge badge-info">直推: {$user.children_count}人</span>
                {/if}
                {if $user.total_descendants > 0}
                <span class="badge badge-warning">团队: {$user.total_descendants}人</span>
                {/if}
            </div>
        </div>
        
        <div class="user-actions">
            <button class="btn btn-primary btn-sm" onclick="viewUserDetail({$user.id})">
                <i class="fa fa-eye"></i> 查看详情
            </button>
        </div>
    </div>
    
    {if $user.childlist && count($user.childlist) > 0}
    <div class="tree-children">
        {volist name="user.childlist" id="child" key="index"}
        {include file="user_tree_item" user="$child" level="$level+1" /}
        {/volist}
    </div>
    {/if}
</div>
